package com.graduationdesign.zengyan.graduationdesignapp.dataLayer.profileRepository;


import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.base.Result;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.Event;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.Organization;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.PeoplesModel;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.User;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.resultModel.EventResultModel;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.resultModel.SignUpResult;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface MainService {





    @POST("user/login")
    Observable<Result<User>> login(@Body Map<String, String> loginMap);

    @GET("user/{stunum}/orgs")
    Observable<Result<List<Organization>>> getMyOrgs(@Path("stunum") String stuNum);

    @GET("user/{stunum}")
    Observable<Result<User>> getProfileInfo(@Path("stunum") String stunum);

    @GET("user/event/all/{stunum}")
    Observable<Result<List<EventResultModel>>> getEventsAll(@Path("stunum") String stunum);

    @POST("/user/signup")
    Observable<Result<SignUpResult>> signUp(@Body Map<String, String> map);

    @GET("user/event/{stunum}")
    Observable<Result<List<Event>>> getEventsIJoinUp(@Path("stunum") String stuNu);

    @GET("user/{stunum}/search")
    Observable<Result<List<User>>> searchUser(@Path("stunum") String stunum, @Query("message") String message);


    @Multipart
    @POST("/user/update/image")
    Observable<Result<User>> updateUserImage(@Part MultipartBody.Part file, @Part("stunum") String stunum , @Part("type") String type);

    


    /**
     * <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<组织接口>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
     */


    @POST("org/event")
    Observable<Result<Event>> createEvent(@Body Map<String,String>  map) ;

    @GET("org/event/{org_id}")
    Observable<Result<List<Event>>> getEventsFromOrg(@Path("org_id") int org_id);

    @GET("org/users/{orgId}")
    Observable<Result<PeoplesModel>> getPeoplesInOrg(@Path("orgId") int id);

    @GET("/org/{org_id}")
    Observable<Result<Organization>> getOrgById(@Path("org_id") int id);








}
